<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link rel="stylesheet" href="../css/style.css" type="text/css" />
</h:head>

<h:body>
	<div>
		<h:form id="form">

			<h3>Bitte waehlen Sie die Liefer/Rechnungsadresse!</h3>
			<p:outputPanel id="customPanel">
				<p:selectOneRadio id="customRadio" value="#{orderCtrl.iAdressNr}">
				<p:dataTable var="current" value="#{customer.jAdressList}">
					<f:selectItem itemLabel="Option 1" itemValue="1" />
					<f:selectItem itemLabel="Option 2" itemValue="2" />
					<f:selectItem itemLabel="Option 3" itemValue="3" />
				</p:dataTable>
				</p:selectOneRadio>

<!-- 

				<h:panelGrid columns="3">
					<p:radioButton id="opt1" for="customRadio" itemIndex="0" />
					<p:dataTable var="current" value="#{customer.jAdressList}">
						<p:column headerText="Land">
							<h:outputText value="#{current.sCountry}" />
						</p:column>

						<p:column headerText="PLZ">
							<h:outputText value="#{current.iPostcode}" />
						</p:column>

						<p:column headerText="Stadt">
							<h:outputText value="#{current.sCity}" />
						</p:column>

						<p:column headerText="Straße">
							<h:outputText value="#{current.sStreet}" />
						</p:column>

						<p:column headerText="Nummer">
							<h:outputText value="#{current.sHouseNr}" />
						</p:column>
					</p:dataTable>

					<p:radioButton id="opt2" for="customRadio" itemIndex="1" />
					<h:outputLabel for="opt2" value="" />
					
				</h:panelGrid>
-->

					<p:panel header="Neue Adresse">
						<h:panelGrid columns="2" cellpadding="5">

							<h:outputText value="Land " />
							<p:inputMask value="#{adress.sCountry}" />

							<h:outputText value="PLZ " />
							<p:inputMask value="#{adress.iPostcode}" />

							<h:outputText value="Stadt " />
							<p:inputMask value="#{adress.sCity}" />

							<h:outputText value="Straße " />
							<p:inputMask value="#{adress.sStreet}" />

							<h:outputText value="Nummer " />
							<p:inputMask value="#{adress.sHouseNr}" />

							<p:commandButton value="Löschen" type="reset" />
							<p:commandButton value="Speichern" action="#{adressCtrl.insertNewAdress(adress)}" />

						</h:panelGrid>
					</p:panel>
			</p:outputPanel>

			<p:commandButton id="submitButton" value="Submit" />

		</h:form>

	</div>
</h:body>
</html>
